<!--
 * @Description: 文件描述
 * @Author: 陈三愿
 * @Date: 2025-09-15 20:05:00
 * @LastEditTime: 2025-09-15 20:05:29
-->
<template>
  <el-table :data="tableData" border style="width: 100%; max-width: 100%; overflow-x: auto;">
    <template v-for="col in config.columns" :key="col.prop">
      <!-- 判断是否使用插槽 -->
      <el-table-column
        v-if="!col.slot"
        :prop="col.prop"
        :label="col.label"
        :formatter="col.formatter"
      />
      <el-table-column v-else :label="col.label">
        <template #default="scope">
          <slot :name="col.slot" :row="scope.row"></slot>
        </template>
      </el-table-column>
    </template>
  </el-table>
</template>

<script setup>
import { defineProps } from "vue";

const props = defineProps({
  config: { type: Object, required: true },
  tableData: { type: Array, required: true },
});
</script>
